<!DOCTYPE html>
<html>
<head>
<title>Crash test for play() promise</title>
</head>
<body>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script>
  internals.settings.setAutoplayPolicy('user-gesture-required');

  async_test(function(t) {
    var video = document.createElement('video');
    video.src = 'content/test.ogv';
    video.play().then(t.step_func_done(function() {
      assert_unreached();
    }), t.step_func(function() {
      // Running gc to make sure the promise returned by |play()| is destructed.
      gc();
      t.done();
    }));
  }, "Test that the rejected promise returned by play() doesn't lead to a crash at dtor.");
</script>
</body>
</html>
